package org.goldenmock.web.matchers;

import org.goldenmock.web.server.EasyHttpRequest;

/**
 * @author Robin Wagenaar
 * @author Arjen van Staalduinen
 */
public class RequestParamEqualsMatcher extends EasyRequestMatcher {
    private final String key;
    private final String value;

    public RequestParamEqualsMatcher(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public boolean matchesEasyRequest(EasyHttpRequest easyHttpRequest) {
        return value.equals(easyHttpRequest.getParameter(key));
    }
}
